home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1998 December / WPCDEC98.ISO / dxrs / Mainmn12.dxr / internet_24_Cut-n-paste Lingo handlers.ls < prev    next >
Encoding:
Text File  |  1998-10-12  |  24.8 KB  |  989 lines

  1. on getTaskList
  2.   global gMasterAppObject
  3.   insureMasterApp()
  4.   return gMasterAppObject(mGetTaskList)
  5. end
  6.  
  7. on getTaskIDs
  8.   global gMasterAppObject
  9.   insureMasterApp()
  10.   return gMasterAppObject(mGetTaskIDs)
  11. end
  12.  
  13. on taskName taskID
  14.   global gVoid, gMasterAppObject
  15.   if not integerp(taskID) then
  16.     warning("taskName(): taskID not an integer")
  17.     return gVoid
  18.   end if
  19.   insureMasterApp()
  20.   return gMasterAppObject(mTaskName, taskID)
  21. end
  22.  
  23. on taskParent taskID
  24.   global gVoid, gMasterAppObject
  25.   if not integerp(taskID) then
  26.     warning("taskParent(): taskID not an integer")
  27.     return gVoid
  28.   end if
  29.   insureMasterApp()
  30.   return gMasterAppObject(mTaskParent, taskID)
  31. end
  32.  
  33. on taskInstance taskID
  34.   global gVoid, gMasterAppObject
  35.   if not integerp(taskID) then
  36.     warning("taskInstance(): taskID not an integer")
  37.     return gVoid
  38.   end if
  39.   insureMasterApp()
  40.   return gMasterAppObject(mTaskInstance, taskID)
  41. end
  42.  
  43. on taskModule taskID
  44.   global gVoid, gMasterAppObject
  45.   if not integerp(taskID) then
  46.     warning("taskModule(): taskID not an integer")
  47.     return gVoid
  48.   end if
  49.   insureMasterApp()
  50.   return gMasterAppObject(mTaskModule, taskID)
  51. end
  52.  
  53. on taskEvents taskID
  54.   global gVoid, gMasterAppObject
  55.   if not integerp(taskID) then
  56.     warning("taskEvents(): taskID not an integer")
  57.     return gVoid
  58.   end if
  59.   insureMasterApp()
  60.   return gMasterAppObject(mTaskEvents, taskID)
  61. end
  62.  
  63. on getTaskWindowList taskID
  64.   global gVoid, gMasterAppObject
  65.   if not integerp(taskID) then
  66.     warning("getTaskWindowList(): taskID not an integer")
  67.     return gVoid
  68.   end if
  69.   insureMasterApp()
  70.   return gMasterAppObject(mGetTaskWindowList, taskID)
  71. end
  72.  
  73. on getTaskWindowIDs taskID
  74.   global gVoid, gMasterAppObject
  75.   if not integerp(taskID) then
  76.     warning("getTaskWindowIDs(): taskID not an integer")
  77.     return gVoid
  78.   end if
  79.   insureMasterApp()
  80.   return gMasterAppObject(mGetTaskWindowIDs, taskID)
  81. end
  82.  
  83. on getWindowTask windowID
  84.   global gVoid, gMasterAppObject
  85.   if not integerp(windowID) then
  86.     warning("getWindowTask(): windowID not an integer")
  87.     return gVoid
  88.   end if
  89.   insureMasterApp()
  90.   return gMasterAppObject(mGetWindowTask, windowID)
  91. end
  92.  
  93. on rudeQuitTask taskID, exitValue
  94.   global gVoid, gMasterAppObject
  95.   if not integerp(taskID) then
  96.     warning("rudeQuitTask(): taskID not an integer")
  97.     return gVoid
  98.   end if
  99.   if not integerp(exitValue) then
  100.     warning("rudeQuitTask(): exitValue not an integer")
  101.     return gVoid
  102.   end if
  103.   insureMasterApp()
  104.   return gMasterAppObject(mRudeQuitTask, taskID, exitValue)
  105. end
  106.  
  107. on taskIsRunning taskID
  108.   global gVoid, gMasterAppObject
  109.   if not integerp(taskID) then
  110.     warning("taskIsRunning(): taskID not an integer")
  111.     return gVoid
  112.   end if
  113.   insureMasterApp()
  114.   return gMasterAppObject(mTaskIsRunning, taskID)
  115. end
  116.  
  117. on feedTimeSlice taskID
  118.   global gVoid, gMasterAppObject
  119.   if not integerp(taskID) then
  120.     warning("feedTimeSlice(): taskID not an integer")
  121.     return gVoid
  122.   end if
  123.   insureMasterApp()
  124.   return gMasterAppObject(mFeedTimeSlice, taskID)
  125. end
  126.  
  127. on feedGenericTimeSlice
  128.   global gMasterAppObject
  129.   insureMasterApp()
  130.   gMasterAppObject(mFeedGenericTimeSlice)
  131. end
  132.  
  133. on directorTask
  134.   global gMasterAppObject
  135.   insureMasterApp()
  136.   return gMasterAppObject(mDirectorTask)
  137. end
  138.  
  139. on getModuleList
  140.   global gMasterAppObject
  141.   insureMasterApp()
  142.   return gMasterAppObject(mGetModuleList)
  143. end
  144.  
  145. on getModuleIDs
  146.   global gMasterAppObject
  147.   insureMasterApp()
  148.   return gMasterAppObject(mGetModuleIDs)
  149. end
  150.  
  151. on moduleTask moduleID
  152.   global gVoid, gMasterAppObject
  153.   if not integerp(moduleID) then
  154.     warning("moduleTask(): moduleID not an integer")
  155.     return gVoid
  156.   end if
  157.   insureMasterApp()
  158.   return gMasterAppObject(mModuleTask, moduleID)
  159. end
  160.  
  161. on moduleFilename moduleID
  162.   global gVoid, gMasterAppObject
  163.   if not integerp(moduleID) then
  164.     warning("moduleFilename(): moduleID not an integer")
  165.     return gVoid
  166.   end if
  167.   insureMasterApp()
  168.   return gMasterAppObject(mModuleFilename, moduleID)
  169. end
  170.  
  171. on directorFilename
  172.   global gMasterAppObject
  173.   insureMasterApp()
  174.   return gMasterAppObject(mDirectorFilename)
  175. end
  176.  
  177. on moduleName moduleID
  178.   global gVoid, gMasterAppObject
  179.   if not integerp(moduleID) then
  180.     warning("moduleName(): moduleID not an integer")
  181.     return gVoid
  182.   end if
  183.   insureMasterApp()
  184.   return gMasterAppObject(mModuleName, moduleID)
  185. end
  186.  
  187. on moduleIsRunning moduleID
  188.   global gVoid, gMasterAppObject
  189.   if not integerp(moduleID) then
  190.     warning("moduleIsRunning(): moduleID not an integer")
  191.     return gVoid
  192.   end if
  193.   insureMasterApp()
  194.   return gMasterAppObject(mModuleIsRunning, moduleID)
  195. end
  196.  
  197. on directorModule
  198.   global gMasterAppObject
  199.   insureMasterApp()
  200.   return gMasterAppObject(mDirectorModule)
  201. end
  202.  
  203. on getParentWindowList
  204.   global gMasterAppObject
  205.   insureMasterApp()
  206.   return gMasterAppObject(mGetParentWindowList)
  207. end
  208.  
  209. on getParentWindowIDs
  210.   global gMasterAppObject
  211.   insureMasterApp()
  212.   return gMasterAppObject(mGetParentWindowID)
  213. end
  214.  
  215. on getChildWindowList windowID
  216.   global gVoid, gMasterAppObject
  217.   if not integerp(windowID) then
  218.     warning("getChildWindowList(): windowID not an integer")
  219.     return gVoid
  220.   end if
  221.   insureMasterApp()
  222.   return gMasterAppObject(mGetChildWindowList, windowID)
  223. end
  224.  
  225. on getChildWindowIDs windowID
  226.   global gVoid, gMasterAppObject
  227.   if not integerp(windowID) then
  228.     warning("getChildWindowIDs(): windowID not an integer")
  229.     return gVoid
  230.   end if
  231.   insureMasterApp()
  232.   return gMasterAppObject(mGetChildWindowIDs, windowID)
  233. end
  234.  
  235. on windowParent windowID
  236.   global gVoid, gMasterAppObject
  237.   if not integerp(windowID) then
  238.     warning("windowParent(): windowID not an integer")
  239.     return gVoid
  240.   end if
  241.   insureMasterApp()
  242.   return gMasterAppObject(mWindowParent, windowID)
  243. end
  244.  
  245. on getWindowParent windowID
  246.   global gVoid, gMasterAppObject
  247.   if not integerp(windowID) then
  248.     warning("getWindowParent(): windowID not an integer")
  249.     return gVoid
  250.   end if
  251.   insureMasterApp()
  252.   return gMasterAppObject(mGetWindowParent, windowID)
  253. end
  254.  
  255. on getHighestWindowParent windowID
  256.   global gVoid, gMasterAppObject
  257.   if not integerp(windowID) then
  258.     warning("getHighestWindowParent(): windowID not an integer")
  259.     return gVoid
  260.   end if
  261.   insureMasterApp()
  262.   return gMasterAppObject(mGetHighestWindowParent, windowID)
  263. end
  264.  
  265. on directorMainWindow
  266.   global gMasterAppObject
  267.   insureMasterApp()
  268.   return gMasterAppObject(mDirectorMainWindow)
  269. end
  270.  
  271. on directorStageWindow
  272.   global gMasterAppObject
  273.   insureMasterApp()
  274.   return gMasterAppObject(mDirectorStageWindow)
  275. end
  276.  
  277. on windowName windowID
  278.   global gVoid, gMasterAppObject
  279.   if not integerp(windowID) then
  280.     warning("windowName(): windowID not an integer")
  281.     return gVoid
  282.   end if
  283.   insureMasterApp()
  284.   return gMasterAppObject(mWindowName, windowID)
  285. end
  286.  
  287. on getWindowName windowID
  288.   global gVoid, gMasterAppObject
  289.   if not integerp(windowID) then
  290.     warning("getWindowName(): windowID not an integer")
  291.     return gVoid
  292.   end if
  293.   insureMasterApp()
  294.   return gMasterAppObject(mGetWindowName, windowID)
  295. end
  296.  
  297. on setWindowName windowID, newText
  298.   global gVoid, gMasterAppObject
  299.   if not integerp(windowID) then
  300.     warning("setWindowName(): windowID not an integer")
  301.     return gVoid
  302.   end if
  303.   if not stringp(newText) then
  304.     warning("setWindowName(): newText not a string")
  305.     return gVoid
  306.   end if
  307.   insureMasterApp()
  308.   return gMasterAppObject(mGetWindowName, windowID)
  309. end
  310.  
  311. on windowHasChildren windowID
  312.   global gVoid, gMasterAppObject
  313.   if not integerp(windowID) then
  314.     warning("windowHasChildren(): windowID not an integer")
  315.     return gVoid
  316.   end if
  317.   insureMasterApp()
  318.   return gMasterAppObject(mWindowHasChildren, windowID)
  319. end
  320.  
  321. on windowType windowID
  322.   global gVoid, gMasterAppObject
  323.   if not integerp(windowID) then
  324.     warning("windowType(): windowID not an integer")
  325.     return gVoid
  326.   end if
  327.   insureMasterApp()
  328.   return gMasterAppObject(mWindowType, windowID)
  329. end
  330.  
  331. on getWindowType windowID
  332.   global gVoid, gMasterAppObject
  333.   if not integerp(windowID) then
  334.     warning("getWindowType(): windowID not an integer")
  335.     return gVoid
  336.   end if
  337.   insureMasterApp()
  338.   return gMasterAppObject(mGetWindowType, windowID)
  339. end
  340.  
  341. on windowIsInvisible windowID
  342.   global gVoid, gMasterAppObject
  343.   if not integerp(windowID) then
  344.     warning("windowIsInvisible(): windowID not an integer")
  345.     return gVoid
  346.   end if
  347.   insureMasterApp()
  348.   return gMasterAppObject(mWindowIsInvisible, windowID)
  349. end
  350.  
  351. on getActiveWindow
  352.   global gMasterAppObject
  353.   insureMasterApp()
  354.   return gMasterAppObject(mGetActiveWindow)
  355. end
  356.  
  357. on setActiveWindow windowID
  358.   global gVoid, gMasterAppObject
  359.   if not integerp(windowID) then
  360.     warning("setActiveWindow(): windowID not an integer")
  361.     return gVoid
  362.   end if
  363.   insureMasterApp()
  364.   return gMasterAppObject(mSetActiveWindow, windowID)
  365. end
  366.  
  367. on getKeyboardInputWindow
  368.   global gMasterAppObject
  369.   insureMasterApp()
  370.   return gMasterAppObject(mGetKeyboardInputWindow)
  371. end
  372.  
  373. on setKeyboardInputWindow windowID
  374.   global gVoid, gMasterAppObject
  375.   if not integerp(windowID) then
  376.     warning("setKeyboardInputWindow(): windowID not an integer")
  377.     return gVoid
  378.   end if
  379.   insureMasterApp()
  380.   return gMasterAppObject(mSetKeyboardInputWindow, windowID)
  381. end
  382.  
  383. on captureMouseInput windowID
  384.   global gVoid, gMasterAppObject
  385.   if not integerp(windowID) then
  386.     warning("captureMouseInput(): windowID not an integer")
  387.     return gVoid
  388.   end if
  389.   insureMasterApp()
  390.   return gMasterAppObject(mCaptureMouseInput, windowID)
  391. end
  392.  
  393. on releaseMouseInput
  394.   global gMasterAppObject
  395.   insureMasterApp()
  396.   gMasterAppObject(mReleaseMouseInput)
  397. end
  398.  
  399. on getParentWindowTopChild windowID
  400.   global gVoid, gMasterAppObject
  401.   if not integerp(windowID) then
  402.     warning("getParentWindowTopChild(): windowID not an integer")
  403.     return gVoid
  404.   end if
  405.   insureMasterApp()
  406.   return gMasterAppObject(mGetParentWindowTopChild, windowID)
  407. end
  408.  
  409. on getDesktopWindow
  410.   global gMasterAppObject
  411.   insureMasterApp()
  412.   return gMasterAppObject(mGetDesktopWindow)
  413. end
  414.  
  415. on getWindowOutsideRect windowID
  416.   global gVoid, gMasterAppObject
  417.   if not integerp(windowID) then
  418.     warning("getWindowOutsideRect(): windowID not an integer")
  419.     return gVoid
  420.   end if
  421.   insureMasterApp()
  422.   return gMasterAppObject(mGetWindowOutsideRect, windowID)
  423. end
  424.  
  425. on getWindowInsideRect windowID
  426.   global gVoid, gMasterAppObject
  427.   if not integerp(windowID) then
  428.     warning("getWindowInsideRect(): windowID not an integer")
  429.     return gVoid
  430.   end if
  431.   insureMasterApp()
  432.   return gMasterAppObject(mGetWindowInsideRect, windowID)
  433. end
  434.  
  435. on setWindowOutsideRect windowID, left, top, bottom, right
  436.   global gVoid, gMasterAppObject
  437.   if not integerp(windowID) then
  438.     warning("setWindowOutsideRect(): windowID not an integer")
  439.     return gVoid
  440.   end if
  441.   if not integerp(left) or not integerp(top) or not integerp(bottom) or not integerp(right) then
  442.     warning("setWindowOutsideRect(): rect dimensions aren't all integers")
  443.     return gVoid
  444.   end if
  445.   insureMasterApp()
  446.   return gMasterAppObject(mSetWindowOutsideRect, windowID, left, top, bottom, right)
  447. end
  448.  
  449. on setWindowRect windowID, left, top, bottom, right
  450.   global gVoid, gMasterAppObject
  451.   if not integerp(windowID) then
  452.     warning("setWindowRect(): windowID not an integer")
  453.     return gVoid
  454.   end if
  455.   if not integerp(left) or not integerp(top) or not integerp(bottom) or not integerp(right) then
  456.     warning("setWindowRect(): rect dimensions aren't all integers")
  457.     return gVoid
  458.   end if
  459.   insureMasterApp()
  460.   return gMasterAppObject(mSetWindowRect, windowID, left, top, bottom, right)
  461. end
  462.  
  463. on closeWindow windowID
  464.   global gVoid, gMasterAppObject
  465.   if not integerp(windowID) then
  466.     warning("closeWindow(): windowID not an integer")
  467.     return gVoid
  468.   end if
  469.   insureMasterApp()
  470.   return gMasterAppObject(mCloseWindow, windowID)
  471. end
  472.  
  473. on windowExists windowID
  474.   global gVoid, gMasterAppObject
  475.   if not integerp(windowID) then
  476.     warning("windowExists(): windowID not an integer")
  477.     return gVoid
  478.   end if
  479.   insureMasterApp()
  480.   return gMasterAppObject(mWindowExists, windowID)
  481. end
  482.  
  483. on windowToFront windowID
  484.   global gVoid, gMasterAppObject
  485.   if not integerp(windowID) then
  486.     warning("windowToFront(): windowID not an integer")
  487.     return gVoid
  488.   end if
  489.   insureMasterApp()
  490.   return gMasterAppObject(mWindowToFront, windowID)
  491. end
  492.  
  493. on windowToBack windowID
  494.   global gVoid, gMasterAppObject
  495.   if not integerp(windowID) then
  496.     warning("windowToBack(): windowID not an integer")
  497.     return gVoid
  498.   end if
  499.   insureMasterApp()
  500.   return gMasterAppObject(mWindowToBack, windowID)
  501. end
  502.  
  503. on hideWindow windowID
  504.   global gVoid, gMasterAppObject
  505.   if not integerp(windowID) then
  506.     warning("hideWindow(): windowID not an integer")
  507.     return gVoid
  508.   end if
  509.   insureMasterApp()
  510.   return gMasterAppObject(mHideWindow, windowID)
  511. end
  512.  
  513. on showWindow windowID
  514.   global gVoid, gMasterAppObject
  515.   if not integerp(windowID) then
  516.     warning("showWindow(): windowID not an integer")
  517.     return gVoid
  518.   end if
  519.   insureMasterApp()
  520.   return gMasterAppObject(mShowWindow, windowID)
  521. end
  522.  
  523. on minimizeWindow windowID
  524.   global gVoid, gMasterAppObject
  525.   if not integerp(windowID) then
  526.     warning("minimizeWindow(): windowID not an integer")
  527.     return gVoid
  528.   end if
  529.   insureMasterApp()
  530.   return gMasterAppObject(mMinimizeWindow, windowID)
  531. end
  532.  
  533. on restoreWindow windowID
  534.   global gVoid, gMasterAppObject
  535.   if not integerp(windowID) then
  536.     warning("restoreWindow(): windowID not an integer")
  537.     return gVoid
  538.   end if
  539.   insureMasterApp()
  540.   return gMasterAppObject(mRestoreWindow, windowID)
  541. end
  542.  
  543. on maximizeWindow windowID
  544.   global gVoid, gMasterAppObject
  545.   if not integerp(windowID) then
  546.     warning("maximizeWindow(): windowID not an integer")
  547.     return gVoid
  548.   end if
  549.   insureMasterApp()
  550.   return gMasterAppObject(mMaximizeWindow, windowID)
  551. end
  552.  
  553. on launch theProgramFile, theCommandLineArguments
  554.   global gMasterAppObject
  555.   if not stringp(theProgramFile) then
  556.     warning("launch(): theProgramFile not a string")
  557.   end if
  558.   if not stringp(theCommandLineArguments) then
  559.     warning("launch(): theCommandLineArguments not a string")
  560.   end if
  561.   insureMasterApp()
  562.   return gMasterAppObject(mLaunch, theProgramFile, theCommandLineArguments)
  563. end
  564.  
  565. on launchButDontActivate theProgramFile, theCommandLineArguments
  566.   global gMasterAppObject
  567.   if not stringp(theProgramFile) then
  568.     warning("launchButDontActivate(): theProgramFile not a string")
  569.   end if
  570.   if not stringp(theCommandLineArguments) then
  571.     warning("launchButDontActivate(): theCommandLineArguments not a string")
  572.   end if
  573.   insureMasterApp()
  574.   return gMasterAppObject(mLaunchButDontActivate, theProgramFile, theCommandLineArguments)
  575. end
  576.  
  577. on launchHidden theProgramFile, theCommandLineArguments
  578.   global gMasterAppObject
  579.   if not stringp(theProgramFile) then
  580.     warning("launchHidden(): theProgramFile not a string")
  581.   end if
  582.   if not stringp(theCommandLineArguments) then
  583.     warning("launchHidden(): theCommandLineArguments not a string")
  584.   end if
  585.   insureMasterApp()
  586.   return gMasterAppObject(mLaunchHidden, theProgramFile, theCommandLineArguments)
  587. end
  588.  
  589. on launchMinimized theProgramFile, theCommandLineArguments
  590.   global gMasterAppObject
  591.   if not stringp(theProgramFile) then
  592.     warning("launchMinimized(): theProgramFile not a string")
  593.   end if
  594.   if not stringp(theCommandLineArguments) then
  595.     warning("launchMinimized(): theCommandLineArguments not a string")
  596.   end if
  597.   insureMasterApp()
  598.   return gMasterAppObject(mLaunchMinimized, theProgramFile, theCommandLineArguments)
  599. end
  600.  
  601. on launchMaximized theProgramFile, theCommandLineArguments
  602.   global gMasterAppObject
  603.   if not stringp(theProgramFile) then
  604.     warning("launchMaximized(): theProgramFile not a string")
  605.   end if
  606.   if not stringp(theCommandLineArguments) then
  607.     warning("launchMaximized(): theCommandLineArguments not a string")
  608.   end if
  609.   insureMasterApp()
  610.   return gMasterAppObject(mLaunchMaximized, theProgramFile, theCommandLineArguments)
  611. end
  612.  
  613. on locateExecutable theFile
  614.   global gVoid, gMasterAppObject
  615.   if not stringp(theFile) then
  616.     warning("locateExecutable(): theFile not a string")
  617.     return gVoid
  618.   end if
  619.   insureMasterApp()
  620.   return gMasterAppObject(mLocateExecutable, theFile)
  621. end
  622.  
  623. on getShortFileName theFile
  624.   global gVoid, gMasterAppObject
  625.   if not stringp(theFile) then
  626.     warning("getShortFileName(): theFile not a string")
  627.     return gVoid
  628.   end if
  629.   insureMasterApp()
  630.   return gMasterAppObject(mGetShortFileName, theFile)
  631. end
  632.  
  633. on getLongFileName theFile
  634.   global gVoid, gMasterAppObject
  635.   if not stringp(theFile) then
  636.     warning("getLongFileName(): theFile not a string")
  637.     return gVoid
  638.   end if
  639.   insureMasterApp()
  640.   return gMasterAppObject(mGetLongFileName, theFile)
  641. end
  642.  
  643. on openDocument theFile
  644.   global gVoid, gMasterAppObject
  645.   if not stringp(theFile) then
  646.     put "here"
  647.     warning("openDocument(): theFile not a string")
  648.     return gVoid
  649.   end if
  650.   insureMasterApp()
  651.   return gMasterAppObject(mOpenDocument, theFile)
  652. end
  653.  
  654. on printDocument theFile
  655.   global gVoid, gMasterAppObject
  656.   if not stringp(theFile) then
  657.     warning("printDocument(): theFile not a string")
  658.     return gVoid
  659.   end if
  660.   insureMasterApp()
  661.   return gMasterAppObject(mPrintDocument, theFile)
  662. end
  663.  
  664. on getDefaultPrinter
  665.   global gMasterAppObject
  666.   insureMasterApp()
  667.   return gMasterAppObject(mGetDefaultPrinter)
  668. end
  669.  
  670. on setDefaultPrinter printerName
  671.   global gVoid, gMasterAppObject
  672.   if not stringp(printerName) then
  673.     warning("setDefaultPrinter(): printerName not a string")
  674.     return gVoid
  675.   end if
  676.   insureMasterApp()
  677.   return gMasterAppObject(mSetDefaultPrinter, printerName)
  678. end
  679.  
  680. on getInstalledPrinters
  681.   global gMasterAppObject
  682.   insureMasterApp()
  683.   return gMasterAppObject(mGetInstalledPrinters)
  684. end
  685.  
  686. on instanceTask instanceID
  687.   global gVoid, gMasterAppObject
  688.   if not integerp(instanceID) then
  689.     warning("instanceTask(): instanceID not an integer")
  690.     return gVoid
  691.   end if
  692.   insureMasterApp()
  693.   return gMasterAppObject(mInstanceTask, instanceID)
  694. end
  695.  
  696. on instanceIsRunning instanceID
  697.   global gVoid, gMasterAppObject
  698.   if not integerp(instanceID) then
  699.     warning("instanceIsRunning(): instanceID not an integer")
  700.     return gVoid
  701.   end if
  702.   insureMasterApp()
  703.   return gMasterAppObject(mInstanceIsRunning, instanceID)
  704. end
  705.  
  706. on fakeMouseClick windowID, x, y
  707.   global gVoid, gMasterAppObject
  708.   if not integerp(windowID) then
  709.     warning("fakeMouseClick(): windowID not an integer")
  710.     return gVoid
  711.   end if
  712.   if not integerp(x) or not integerp(y) then
  713.     warning("fakeMouseClick(): x and y coordinates not both integers")
  714.     return gVoid
  715.   end if
  716.   insureMasterApp()
  717.   return gMasterAppObject(mFakeMouseClick, windowID, x, y)
  718. end
  719.  
  720. on fakeMouseClickWait windowID, x, y
  721.   global gVoid, gMasterAppObject
  722.   put EMPTY
  723.   if not integerp(windowID) then
  724.     put "R"
  725.     warning("fakeMouseClickWait(): windowID not an integer")
  726.     return gVoid
  727.   end if
  728.   if not integerp(x) or not integerp(y) then
  729.     put "e"
  730.     warning("fakeMouseClickWait(): x and y coordinates not both integers")
  731.     return gVoid
  732.   end if
  733.   insureMasterApp()
  734.   return gMasterAppObject(mFakeMouseClickWait, windowID, x, y)
  735. end
  736.  
  737. on fakeCharacter windowID, theChar
  738.   global gVoid, gMasterAppObject
  739.   if not integerp(windowID) then
  740.     warning("fakeCharacter(): windowID not an integer")
  741.     return gVoid
  742.   end if
  743.   if not stringp(theChar) then
  744.     warning("fakeCharacter(): theChar not a string")
  745.     return gVoid
  746.   end if
  747.   if not (the number of chars in theChar = 1) then
  748.     warning("fakeCharacter(): theChar more than one character")
  749.     return gVoid
  750.   end if
  751.   insureMasterApp()
  752.   return gMasterAppObject(mFakeCharacter, windowID, theChar)
  753. end
  754.  
  755. on fakeCharacterWait windowID, theChar
  756.   global gVoid, gMasterAppObject
  757.   if not integerp(windowID) then
  758.     warning("fakeCharacterWait(): windowID not an integer")
  759.     return gVoid
  760.   end if
  761.   if not stringp(theChar) then
  762.     warning("fakeCharacterWait(): theChar not a string")
  763.     return gVoid
  764.   end if
  765.   if not (the number of chars in theChar = 1) then
  766.     warning("fakeCharacterWait(): theChar more than one character")
  767.     return gVoid
  768.   end if
  769.   insureMasterApp()
  770.   return gMasterAppObject(mFakeCharacterWait, windowID, theChar)
  771. end
  772.  
  773. on fakeCharCode windowID, charNum, codeNum
  774.   global gVoid, gMasterAppObject
  775.   if not integerp(windowID) then
  776.     warning("fakeCharCode(): windowID not an integer")
  777.     return gVoid
  778.   end if
  779.   if not integerp(charNum) or not integerp(codeNum) then
  780.     warning("fakeCharCode(): charNum and codeNum not both integers")
  781.     return gVoid
  782.   end if
  783.   insureMasterApp()
  784.   return gMasterAppObject(mFakeCharCode, windowID, charNum, codeNum)
  785. end
  786.  
  787. on fakeCharCodeWait windowID, charNum, codeNum
  788.   global gVoid, gMasterAppObject
  789.   if not integerp(windowID) then
  790.     warning("fakeCharCodeWait(): windowID not an integer")
  791.     return gVoid
  792.   end if
  793.   if not integerp(charNum) or not integerp(codeNum) then
  794.     warning("fakeCharCodeWait(): charNum and codeNum not both integers")
  795.     return gVoid
  796.   end if
  797.   insureMasterApp()
  798.   return gMasterAppObject(mFakeCharCodeWait, windowID, charNum, codeNum)
  799. end
  800.  
  801. on showMenu windowID
  802.   global gVoid, gMasterAppObject
  803.   if not integerp(windowID) then
  804.     warning("showMenu(): windowID not an integer")
  805.     return gVoid
  806.   end if
  807.   insureMasterApp()
  808.   return gMasterAppObject(mShowMenu, windowID)
  809. end
  810.  
  811. on showMenuWait windowID
  812.   global gVoid, gMasterAppObject
  813.   if not integerp(windowID) then
  814.     warning("showMenuWait(): windowID not an integer")
  815.     return gVoid
  816.   end if
  817.   insureMasterApp()
  818.   return gMasterAppObject(mShowMenuWait, windowID)
  819. end
  820.  
  821. on anyWindowAtPoint x, y
  822.   global gVoid, gMasterAppObject
  823.   if not integerp(x) or not integerp(y) then
  824.     warning("anyWindowAtPoint(): x and y coordinates not both integers")
  825.     return gVoid
  826.   end if
  827.   insureMasterApp()
  828.   return gMasterAppObject(mAnyWindowAtPoint, x, y)
  829. end
  830.  
  831. on childWindowAtPoint windowID, x, y
  832.   global gVoid, gMasterAppObject
  833.   if not integerp(windowID) then
  834.     warning("childWindowAtPoint(): windowID not an integer")
  835.     return gVoid
  836.   end if
  837.   if not integerp(x) or not integerp(y) then
  838.     warning("childWindowAtPoint(): x and y coordinates not both integers")
  839.     return gVoid
  840.   end if
  841.   insureMasterApp()
  842.   return gMasterAppObject(mChildWindowAtPoint, windowID, x, y)
  843. end
  844.  
  845. on insureMasterApp
  846.   global j2736D2937m2382, gMasterAppObject, gVoid
  847.   if objectp(gMasterAppObject) then
  848.     return 1
  849.   end if
  850.   if not objectp(factory("MasterApp")) then
  851.     if not openMasterApp() then
  852.       warning("insureMasterApp(): openMasterApp() failed")
  853.       abort()
  854.     end if
  855.   end if
  856.   set j2736D2937m2382 to "Y7729J3338j3942"
  857.   set gMasterAppObject to MasterApp(mnew)
  858.   set j2736D2937m2382 to gVoid
  859.   if not objectp(gMasterAppObject) then
  860.     warning("insureMasterApp(): couldn't create object")
  861.     abort()
  862.   end if
  863.   return 1
  864. end
  865.  
  866. on openMasterApp
  867.   global gMasterAppObject
  868.   if objectp(gMasterAppObject) then
  869.     return 1
  870.   end if
  871.   if objectp(factory("MasterApp")) then
  872.     return 1
  873.   end if
  874.   set xoName to "MastrApp.dll"
  875.   if the machineType < 256 then
  876.     set xoName to "MasterApp XObject"
  877.   end if
  878.   if not fileExists(the pathName & xoName) then
  879.     warning("loadMasterApp(): XObject not open and can't be located")
  880.     return 0
  881.   end if
  882.   openXLib(xoName)
  883.   if not objectp(factory("MasterApp")) then
  884.     warning("loadMasterApp(): XObject located, but didn't register")
  885.     return 0
  886.   end if
  887.   return 1
  888. end
  889.  
  890. on closeMasterApp
  891.   global gMasterAppObject
  892.   if objectp(gMasterAppObject) then
  893.     gMasterAppObject(mdispose)
  894.   end if
  895.   if not objectp(factory("MasterApp")) then
  896.     return 1
  897.   end if
  898.   if the machineType >= 256 then
  899.     closeXLib("MastrApp.dll")
  900.   else
  901.     closeXLib("MasterApp XObject")
  902.   end if
  903.   if objectp(factory("MasterApp")) then
  904.     warning("closeMasterApp(): XObject file couldn't be closed (objects still exist?)")
  905.     return 0
  906.   end if
  907.   return 1
  908. end
  909.  
  910. on fileExists theFile
  911.   set thePath to pathOnly(theFile)
  912.   if thePath = EMPTY then
  913.     set thePath to the pathName
  914.   end if
  915.   set fileName to fileOnly(theFile)
  916.   repeat with i = 1 to the maxinteger
  917.     set thisFile to getNthFileNameInFolder(thePath, i)
  918.     if thisFile = EMPTY then
  919.       return 0
  920.     end if
  921.     if thisFile = fileName then
  922.       return 1
  923.     end if
  924.   end repeat
  925.   if not objectp(factory("FileIO")) then
  926.     return 0
  927.   end if
  928.   set fioObject to fileio(mnew, "read", theFile)
  929.   if objectp(fioObject) then
  930.     fioObject(mdispose)
  931.     return 1
  932.   end if
  933.   return 0
  934. end
  935.  
  936. on fileOnly thePath
  937.   set oldDelim to the itemDelimiter
  938.   set the itemDelimiter to ":"
  939.   if the machineType >= 256 then
  940.     set the itemDelimiter to "\"
  941.   end if
  942.   set ni to the number of items in thePath
  943.   set returnValue to item ni of thePath
  944.   set the itemDelimiter to oldDelim
  945.   return returnValue
  946. end
  947.  
  948. on pathOnly thePath
  949.   set oldDelim to the itemDelimiter
  950.   set the itemDelimiter to ":"
  951.   if the machineType = 256 then
  952.     set the itemDelimiter to "\"
  953.   end if
  954.   set ni to the number of items in thePath
  955.   if ni = 1 then
  956.     set returnValue to EMPTY
  957.   else
  958.     set returnValue to item 1 to ni - 1 of thePath & the itemDelimiter
  959.   end if
  960.   set the itemDelimiter to oldDelim
  961.   return returnValue
  962. end
  963.  
  964. on fileThere theFile
  965.   warning("fileThere(): obsolete. Use fileExists() instead.")
  966.   return fileExists(theFile)
  967. end
  968.  
  969. on warning msg
  970.   global gShowWarning
  971.   if not integerp(gShowWarning) then
  972.     return 
  973.   end if
  974.   if gShowWarning <> 1 then
  975.     return 
  976.   end if
  977.   alert(msg)
  978. end
  979.  
  980. on hideWarnings
  981.   global gShowWarning
  982.   set gShowWarning to 0
  983. end
  984.  
  985. on showWarnings
  986.   global gShowWarning
  987.   set gShowWarning to 1
  988. end
  989.